﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 招聘网站
{
    public partial class Form4 : Form
    {
        public static string i;
        public static string u;
        public Form4()
        {
            InitializeComponent();
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string a = "";
            if (radioButton1.Checked == true)
                a = radioButton1.Text;
            else
                a = radioButton2.Text;
            string b = "";
            if (radioButton3.Checked == true)
                b  = radioButton3.Text;
            else
                b  = radioButton4.Text;
            string c = "";
            if (checkBox1.Checked == true)
                c = checkBox1.Text;
            if (checkBox2.Checked == true)
                c = checkBox2.Text;
            if (checkBox3.Checked == true)
                c = checkBox3.Text;

            string SqlStr = "server=.;database=zhaopin;integrated security=SSPI";
            SqlConnection con = new SqlConnection(SqlStr);
            con.Open();
            SqlCommand comm = new SqlCommand();
            comm.Connection = con;
            comm.CommandText = "insert into table_3(jingyan,xuewei,tongzhao,jiudutime,school,zhuanye,gzxingzhi,gzdidian,cszhiye,yuexin,phonenumb) values( '" + a + "','" + textBox1 .Text + "','" + b + "','" + textBox2 .Text  + "','" + textBox3.Text + "','" + textBox4.Text + "','"+c +"','"+textBox5 .Text +"','" + textBox6.Text + "','" + textBox7.Text + "','"+Form1 .b+"')";
            if (comm.ExecuteNonQuery()>0)
            {
                i = textBox1.Text;
                u = textBox6.Text;
                MessageBox.Show("创建简历成功", "正确", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                Form3 f3 = new Form3();
                f3.Show();
                this.Hide();
            }
            else
                MessageBox.Show("未全部添加，请重新输入！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
            textBox5.Clear();
            textBox6.Clear();
            textBox7.Clear();
            textBox1.Focus();
        }

        private void Form4_Load(object sender, EventArgs e)
        {

        }
    }
}
